<?php

namespace app\common\model;

class BisLocation extends BaseModel
{
    //获取店铺信息
    public function getLocation()
    {
        //获取用户登录信息
        $account = session('account', '', 'bis');
        //查询到所属的商户
        $res = model('BisAccount')->get(['username' => $account->username]);
        $data = [
            'status' => 1,
            'bis_id' => $res['bis_id']
        ];
        return $this->where($data)->select();
    }

    public function getLocationName($bisId)
    {
        $location = $this->where(['bis_id' => $bisId])->select();
        return $location;
    }

    //获取商品详情页分店信息
    public function getNormalLocationsInId($ids)
    {
        $where = [
            'id' => ['in', $ids],
            'status' => 1
        ];
        return $this->where($where)->select();
    }
}
